home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / game / patch / AllTerrainRaci.lha / AllTerrainRacingHD / Install < prev    next >
Text File  |  2000-11-26  |  4KB  |  214 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of the readme file
  4.  
  5. (procedure P_MakeImages
  6.  
  7.   ;the following lines must be copied and adjusted for multiple disk images
  8.  
  9.   (set #CI_disknum 1)
  10.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  11.   (set #CI_disklen 901120)
  12.   (set #CI_skiptrk -1)
  13.   (P_CreateImage)
  14.  
  15.   (set #CI_disknum 2)
  16.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  17.   (P_CreateImage)
  18. )
  19.  
  20. ;****************************
  21. ;----------------------------
  22. ; checks if given program is installed, if not abort install
  23. ; #program - to check
  24.  
  25. (procedure P_ChkRun
  26.   (if
  27.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  28.     ("")
  29.     (abort 
  30.       (cat
  31.     "You must install \"" #program "\" first!\n"
  32.     "It must be accessible via the path.\n"
  33.     "You can find it in the WHDLoad package."
  34.       )
  35.     )
  36.   )
  37. )
  38.  
  39. ;----------------------------
  40. ; Create Image using DIC
  41. ; #dest        - path to save image in
  42. ; #CI_disknum  - number of the disk image to create
  43. ; #CI_diskname - label of the disk
  44. ; #CI_disklen  - length of disk image to create
  45. ; #CI_skiptrk  - track to skip, -1 means no skip
  46. ; #CI_drive    - drive to create image from
  47.  
  48. (procedure P_CreateImage
  49.   (message
  50.     (cat
  51.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  52.     "(make sure it's the right disk because it will not be checked)"
  53.     )
  54.   )
  55.   (if
  56.     (>= #CI_skiptrk 0)
  57.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  58.     (set #option "")
  59.   )
  60.   (if
  61.     (= 0
  62.       (run 
  63.         (cat
  64.           "cd \"" #dest "\"\n"
  65.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  66.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  67.         )
  68.       )
  69.     )
  70.     (run ("FileNote %s Quiet" #CI_diskname))
  71.     (abort "\"DIC\" has failed to create a diskimage")
  72.   )
  73. )
  74.  
  75. ;****************************
  76.  
  77. (if
  78.   (exists #readme-file)
  79.   (if
  80.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  81.     ("")
  82.     (run ("SYS:Utilities/More %s" #readme-file))
  83.   )
  84. )
  85.  
  86. (set #program "WHDLoad")
  87. (P_ChkRun)
  88.  
  89. (set #program "DIC")
  90. (P_ChkRun)
  91.  
  92. ; in expert mode ask for source drive
  93. (if
  94.   (= @user-level 2)
  95.   (
  96.     (set #CI_drive
  97.       (askchoice
  98.     (prompt "Select source drive for diskimages")
  99.     (default 0)
  100.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  101.     (help @askchoice-help)
  102.       )
  103.     )
  104.     (select #CI_drive
  105.       (set #CI_drive "DF0:")
  106.       (set #CI_drive "DF1:")
  107.       (set #CI_drive "RAD:")
  108.       (set #CI_drive
  109.         (askstring
  110.           (prompt "Select source drive for diskimages")
  111.           (default "DF0:")
  112.           (help @askstring-help)
  113.         )
  114.       )
  115.     )
  116.   )
  117.   (set #CI_drive "DF0:")
  118. )
  119.  
  120. (set @default-dest
  121.   (askdir
  122.     (prompt 
  123.       (cat
  124.     "Where should \"" @app-name "\" be installed?\n"
  125.     "A drawer \"" @app-name "\" will be automatically created."
  126.       )
  127.     )
  128.     (help @askdir-help)
  129.     (default @default-dest)
  130.     (disk)
  131.   )
  132. )
  133. (set #dest (tackon @default-dest @app-name))
  134. (if
  135.   (exists #dest)
  136.   (
  137.     (set #choice
  138.       (askbool
  139.         (prompt
  140.           (cat
  141.             "\nDirectory \"" #dest "\" already exists.\n"
  142.             "Should it be deleted?"
  143.           )
  144.         )
  145.         (default 1)
  146.         (choices "Delete" "Skip")
  147.         (help @askbool-help)
  148.       )
  149.     )
  150.     (if
  151.       (= #choice 1)
  152.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  153.     )
  154.   )
  155. )
  156. (makedir #dest
  157.   (help @makedir-help)
  158.   (infos)
  159. )
  160.  
  161. ;----------------------------
  162.  
  163. (copyfiles
  164.   (help @copyfiles-help)
  165.   (source ("%s.Slave" @app-name))
  166.   (dest #dest)
  167. )
  168. (if
  169.   (exists ("%s.newicon" @app-name))
  170.   (set #icon
  171.     (askchoice
  172.       (prompt "\nWhich icon would you like to install?\n")
  173.       (default 0)
  174.       (choices "Normal" "NewIcon" "GlowIcon")
  175.       (help @askchoice-help)
  176.     )
  177.   )
  178.   (set #icon 0)
  179. )
  180. (select #icon
  181.   (set #icon ("%s.inf" @app-name))
  182.   (set #icon ("%s.newicon" @app-name))
  183.   (set #icon ("%s.glowicon" @app-name))
  184. )
  185. (copyfiles
  186.   (help @copyfiles-help)
  187.   (source #icon)
  188.   (newname ("%s.info" @app-name))
  189.   (dest #dest)
  190. )
  191. (if
  192.   (exists #readme-file)
  193.   (copyfiles
  194.     (help @copyfiles-help)
  195.     (source #readme-file)
  196.     (dest #dest)
  197.   )
  198. )
  199. (if
  200.   (exists ("%s.info" #readme-file))
  201.   (copyfiles
  202.     (help @copyfiles-help)
  203.     (source ("%s.info" #readme-file))
  204.     (dest #dest)
  205.   )
  206. )
  207.  
  208. (P_MakeImages)
  209.  
  210. ;----------------------------
  211.  
  212. (exit)
  213.  
  214.